package cn.thoughtworks.school.repositories;

import cn.thoughtworks.school.entities.Publisher;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface PublisherRepository extends JpaRepository<Publisher,Long> {
  List<Publisher> findByOrganizationId(Long organizationId);

  Publisher findByUserId(Long userId);

  Optional<Publisher> findByOrganizationIdAndUserId(long currentOrganizationId, Long userId);
}
